Dynomotion

Group: DynoMotion Message: 6595 From: bluetoad559 Date: 1/24/2013
Subject: Just set a persist variable with VB, yeehaw
First, let me say I'm NO programmer. And I've been acquainted with .NET less than 24 hours. And I spent most of those hours yelling at the computer. LOL

But, I finally did have a measure of success. I was able to write to a persist variable from the VB app. I tried every combination and 'had' to hit something that worked eventually. Here's what finally did something without tossing out error messages. I created a new button as used the line below to do the dirty work.

If KM_WriteLine("SetPersistHex95 2710") Then myerror()

This sets 2710 hex into persist variable 95 and this ultimately goes to my cheap chinese vfd as 100.00 hz (2710 hex = 10000, or 100.00 hz in vfd speak) which sets it to 6000 rpm. This might not be the best way but I wanted to put some sort of example on here. I searched and couldn't find anything.

I haven't tried reading a persist variable yet but that's next. After a celebratory beverage. :-)





> Are these the functions that should work with VB ?
> public int GetUserData(int index)
> public void SetUserData(int index, int data)
>
> Thanks
>
Group: DynoMotion Message: 6597 From: Tom Kerekes Date: 1/24/2013
Subject: Re: Just set a persist variable with VB, yeehaw
Apparently you ARE a programmer.
Congrats.
TK


Group: DynoMotion Message: 6599 From: bluetoad559 Date: 1/24/2013
Subject: Re: Just set a persist variable with VB, yeehaw
The reading of a persistUserData was easy after the getting it to write. Here's what seems to work ok:

If KM_WriteLineReadLine("GetPersistHex 95", rtrnstr) > 0 Then myerror()
PUDbox.Text = ("RPM h: " & rtrnstr & " RPM d: " & Val("&H" & rtrnstr & "&"))

The returned rpm value gets jammed into a textbox in both hex and decimal formats.





--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Apparently you ARE a programmer.
> Congrats.
> TK
>
>
>
>
> ________________________________
> From: bluetoad559
> To: DynoMotion@yahoogroups.com
> Sent: Thursday, January 24, 2013 5:00 PM
> Subject: [DynoMotion] Just set a persist variable with VB, yeehaw
>
>
>  
>
>
> First, let me say I'm NO programmer. And I've been acquainted with .NET less than 24 hours. And I spent most of those hours yelling at the computer. LOL
>
> But, I finally did have a measure of success. I was able to write to a persist variable from the VB app. I tried every combination and 'had' to hit something that worked eventually. Here's what finally did something without tossing out error messages. I created a new button as used the line below to do the dirty work.
>
> If KM_WriteLine("SetPersistHex95 2710") Then myerror()
>
> This sets 2710 hex into persist variable 95 and this ultimately goes to my cheap chinese vfd as 100.00 hz (2710 hex = 10000, or 100.00 hz in vfd speak) which sets it to 6000 rpm. This might not be the best way but I wanted to put some sort of example on here. I searched and couldn't find anything.
>
> I haven't tried reading a persist variable yet but that's next. After a celebratory beverage. :-)
>
> > Are these the functions that should work with VB ?
> > public int GetUserData(int index)
> > public void SetUserData(int index, int data)
> >
> > Thanks
> >
>